package com.mapper;

import com.entity.Movie;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Milburn
 * @create 2021-03-01 17:25
 */
@Repository
public interface MovieMapper {
    Movie findMovieById(long movie_id);

    Movie findMovieByName(String movie_cn_name);

    Integer addMovie(com.entity.Movie movie);

    Integer deleteMovie(long movie_id);

    Integer updateMovie(com.entity.Movie movie);

    Integer addMovieCommentCount(long movie_id);

    Integer deleteMovieCommentCount(long movie_id);

    Integer changeMovieBoxOffice(@Param("movie_boxOffice") float movie_boxOffice,
                                 @Param("movie_id") long movie_id);

    List<Movie> findAllMovies(int movie_state);

    List<Movie> findMoviesLikeName(String name);

    List<Movie> findMoviesLikeType(String type);

    List<Movie> sortMovieByDate();

    List<Movie> sortMovieByCount();

    List<Movie> sortMovieByScore();

    List<Movie> sortMovieByBoxOffice();
}
